package com.example;

import java.util.*;

public class Test {

    public static void main(String[] args) {
        String esSwitch = System.getProperty("msgLogFromEs", "false");
        if ("true".equals(esSwitch)) {
            System.out.println("从jvm中获取参数msgLogFromEs的值为true将从es获取消息轨迹数据");
        }
        System.out.println(false);
    }

    public static void main3(String[] args) {
        // 创建两个 ArrayList
        ArrayList<String> list1 = new ArrayList<>(Arrays.asList("apple", "banana", "orange", "grape"));
        ArrayList<String> list2 = new ArrayList<>(Arrays.asList("banana", "grape", "aaa"));

        System.out.println("Before removeAll: " + list1);

        // 使用 removeAll 方法移除 list2 中的所有元素
        boolean isModified = list1.removeAll(list2);

        System.out.println("After removeAll: " + list1);
        System.out.println("Is the list modified? " + isModified);
    }

    public static void main2(String[] args) {
//        long num = 1723103476901;
//        Date date = new Date(num);
//        System.out.println(date);
    }

    public static void main1(String[] args) {
        String ids = "001,002,003";
        String id1 = "002,003,001";
        String id2 = "002,003";

        // 将字符串分割成数组并转换为Set集合
        Set<String> setIds = new HashSet<>(Arrays.asList(ids.split(",")));
        Set<String> setId1 = new HashSet<>(Arrays.asList(id1.split(",")));
        Set<String> setId2 = new HashSet<>(Arrays.asList(id2.split(",")));


        System.out.println(setIds.equals(setId1));
        System.out.println(setIds.equals(setId2));


        System.out.println("=================================\n\n");

        // 检查ids和id1是否相同
        boolean areIdsAndId1Equal = setIds.equals(setId1);
        System.out.println("ids 和 id1 一样吗? " + areIdsAndId1Equal);

        // 检查id2和id1是否不同
        boolean areId2AndId1Different = !setId2.equals(setId1);
        System.out.println("id2 和 id1 不一样吗? " + areId2AndId1Different);
    }
}
